{% extends 'layout.html' %}
{% load permission %}
{% block content %}
    <h1>user list</h1>
    {% if request|has_permission:"add_user" %}
        <a href="{% url 'add_user' %}">新建</a>
    {% endif %}
    <hr/>
    {% gen_and_permission request "add_user" "新建用户" %}
    <table>
        <thead>
        <tr>
            <th>ID</th>
            <th>Name</th>
            <th>operater</th>
        </tr>
        </thead>
        <tbody>
        <tr>
            <td>1</td>
            <td>shanyongxu</td>
            <td>
                {% gen_and_permission request "edit_user" "edit user" uid=1 %}
            </td>
        </tr>
        <tr>
            <td>1</td>
            <td>shanyongxu333</td>
            <td>
                {% gen_and_permission request "edit_user" "edit user" uid=2 %}
            </td>
        </tr>
        </tbody>
    </table>
{% endblock %}